using JetBrains.Annotations;

namespace SageKing.Studio.Extensions;

/// <summary>
/// Provides extension methods for <see cref="ExpressionJson"/>.
/// </summary>
[PublicAPI]
public static class ExpressionDescriptorExtensions
{
    /// <summary>
    /// Gets the expression language to use for the Monaco editor.
    /// </summary>
    public static string? GetMonacoLanguage(this ExpressionDescriptorJson descriptor) => descriptor.Properties.TryGetValue("MonacoLanguage", out var language) ? language : null;
}